<div class="modal" id="editModal">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h3 ng-hide='isNew'>Editar Usu&aacute;rio: {{item.login}}</h3>
				<h3 ng-show='isNew'>Incluir Usu&aacute;rio</h3>
			</div>
			<form name="detailForm" ng-controller="DefaultFormCtrl" novalidate>
				<div class="modal-body">
					<div class="form-group" ng-class="{ 'has-error' : detailForm.selFunc.$invalid && !detailForm.selFunc.$pristine }">
						<label for="selFunc">Funcion&aacute;rio</label>
						<select class="form-control" id="selFunc" name="selFunc" ng-model="item.funcionario.id" ng-options="f.id as f.nomeCompleto for f in funcionarios" required>
					    	<option value="">Selecione</option>
					  	</select>
					  	<span class="help-block" ng-show="detailForm.selFunc.$invalid && !detailForm.selFunc.$pristine">Campo obrigat&oacute;rio!</span>
					</div>
					<div class="form-group" ng-class="{ 'has-error' : detailForm.inputLogin.$invalid && !detailForm.inputLogin.$pristine }">
						<label for="inputLogin">Login</label>
						<input type="text" class="form-control" id="inputLogin" name="inputLogin" maxlength="10" placeholder="Login" ng-model="item.login" required/>
						<span class="help-block" ng-show="detailForm.inputLogin.$invalid && !detailForm.inputLogin.$pristine">Campo obrigat&oacute;rio!</span>
					</div>
					<div class="form-group" ng-class="{ 'has-error' : detailForm.inputSenha.$invalid && !detailForm.inputSenha.$pristine }">
						<label for="inputSenha">Senha</label>
						<input type="password" class="form-control" id="inputSenha" name="inputSenha" maxlength="10" placeholder="Senha" ng-model="item.senha" required/>
						<span class="help-block" ng-show="detailForm.inputSenha.$invalid && !detailForm.inputSenha.$pristine">Campo obrigat&oacute;rio!</span>
					</div>
					<div class="form-group" ng-class="{ 'has-error' : detailForm.selNivel.$invalid && !detailForm.selNivel.$pristine }">
						<label for="selNivel">N&iacute;vel</label>
						<select class="form-control" id="selNivel" name="selNivel" ng-model="item.nivel" required>
							<option value="">Selecione</option>
							<option value="1">Administrador</option>
							<option value="2">Gerente</option>
							<option value="3">Caixa</option>
						</select>
						<span class="help-block" ng-show="detailForm.selNivel.$invalid && !detailForm.selNivel.$pristine">Campo obrigat&oacute;rio!</span>
					</div>
					<div class="checkbox">
						<label for="cbxAtivo"><input type="checkbox" id="cbxAtivo" ng-model="item.ativo" ng-true-value="S" ng-false-value="N"> Ativo</label>
					</div>
				</div>
				<div class="modal-footer">
					<button class="btn btn-default" data-dismiss="modal" role="button">Fechar</button>
					<button ng-hide='isNew' class="btn btn-primary" id="btnAtualizar" data-dismiss="modal" ng-click="update()" role="button" ng-disabled="detailForm.$invalid">Atualizar</button>
					<button ng-show='isNew' class="btn btn-primary" id="btnIncluir" data-dismiss="modal" ng-click="insert()" role="button" ng-disabled="detailForm.$invalid">Incluir</button>
				</div>
			</form>
		</div>
	</div>
</div>